package itheima.zuoye.test1.d02;

public class Test {
    public static void main(String[] args) {
     bread(new Cat("猫", 1, "母猫"));
     bread(new Dog("狗", 2, "母狗"));
     bread(new Pig("猪", 3, "母猪"));


    }
    public static void bread(dongwu dw){
        dw.eat();

        if ( dw instanceof Cat){
            Cat c = (Cat) dw;
            c.eatCatLong();

        }


    }
}
